package edu.sctu.zhengsenwen.month201506.day20150615.files;

import java.io.File;

/**
 * Created by user15 on 2015/6/14.
 */
public class DeleteFile {

    public DeleteFile() {

        File file = new File("C:\\C20\\newFile.txt");

        boolean result = false;

        if (file.exists()) {

            try {
                result = file.delete();

                if (result) {

                    System.out.println("成功删除文件");
                }
            } catch (Exception ex) {
            }
        } else {

            System.out.println("文件不存在");
        }
    }

    public static void main(String[] args) {
        new DeleteFile();
    }
}
